
package com.roc.web.action.finance;

import java.sql.Date;
import java.util.ArrayList;
import java.util.List;

import com.roc.page.BaseSearchCondition;
import com.roc.page.WhereHQLFieldBean;
import com.roc.util.Constance;

/**
 * @author Administrator
 *
 */
public class FinanceSearchCondition extends BaseSearchCondition {
	
	private String diffflag;;
	private String startDate;
	private String endDate;
	
	@Override
	protected String getOrderPartOfHQL() {
		// TODO Auto-generated method stub
		
		return " order by d.insertt ";
	}

	@Override
	protected String getRowCountHQL() {
		// TODO Auto-generated method stub
		
		return " select count(*) from DuizhangBean d where 1=1 ";
	}

	
	@Override
	protected String getSearchHQL() {
		// TODO Auto-generated method stub
		
		return " from DuizhangBean d where 1=1  ";
	}

	
	@Override
	protected List<WhereHQLFieldBean> getWhereHQLFieldBeanList() {
		List<WhereHQLFieldBean> filedBeanList = new ArrayList<WhereHQLFieldBean>();

		
		if (Constance.isNotEmpty(diffflag)&&!(diffflag.equals("99"))) {
			filedBeanList.add(new WhereHQLFieldBean("d.diffflag", diffflag.trim()
					.trim(), "=", false));
		}
		if(Constance.isNotEmpty(startDate)&&Constance.isNotEmpty(endDate)){
	       /*	Date date1=Constance.formateStartDate(startDate);
	       	Date date2 =Constance.formateEndDate(endDate);*/
	       	filedBeanList.add(new WhereHQLFieldBean(" d.insertt",startDate.trim()+"000000",
					">=", false));
        	filedBeanList.add(new WhereHQLFieldBean(" d.insertt",endDate.trim()+"235959",
        			"<=", false));
	    }
	

		return filedBeanList;
	}

	
	
	public String getDiffflag() {
		return diffflag;
	}

	public void setDiffflag(String diffflag) {
		this.diffflag = diffflag;
	}

	public String getStartDate() {
		return startDate;
	}

	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}

	public String getEndDate() {
		return endDate;
	}

	public void setEndDate(String endDate) {
		this.endDate = endDate;
	}

	public static void main(String[] args) {
		FinanceSearchCondition s=new FinanceSearchCondition();
		Object[] ids=new Object[]{"dxpeng","lisi","wangwu"};
		
	}
}
